package com.my.vote.entity;

public enum VoteStatus {

	草稿("草稿", 0), 进行中("进行中", 1), 已结束("已结束", 2);

	private String name;
	private int value;

	private VoteStatus(String name, int value) {
		this.name = name;
		this.value = value;
	}

	public static String getName(int value) {
		for (VoteStatus c : VoteStatus.values()) {
			if (c.getValue() == value) {
				return c.name;
			}
		}
		return null;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getValue() {
		return value;
	}

	public void setValue(int value) {
		this.value = value;
	}

}
